home *** CD-ROM | disk | FTP | other *** search
- DLADDR(3C) Last changed: 1-8-99
-
-
- NNAAMMEE
- ddllaaddddrr - Translates address to symbolic information
-
- SSYYNNOOPPSSIISS
- cccc [_f_l_a_g_s ...] [_f_i_l_e ...]
-
- ##iinncclluuddee <<ddllffccnn..hh>> iinntt ddllaaddddrr((vvooiidd **aaddddrreessss,, DDll__iinnffoo **ddlliipp));;
-
- IIMMPPLLEEMMEENNTTAATTIIOONN
- IRIX systems
-
- DDEESSCCRRIIPPTTIIOONN
- ddllaaddddrr(()) determines if the specified address is located within one of
- the mapped objects (either the executable or a DSO) that make up the
- current application address space. If the address is within an
- object, the symbol table available to the run-time linker (rrlldd(1)) is
- searched to locate the nearest symbol to the specified address. The
- nearest symbol is one that has a value less than or equal to the
- required address.
-
- The DDll__iinnffoo structure must be preallocated by the user. The structure
- members are filled in by ddllaaddddrr(()) based on the specified address. The
- DDll__iinnffoo structure contains at least the following members:
-
- const char * dli_fname;
- void * dli_fbase;
- const char * dli_sname;
- void * dli_saddr;
-
- The members are defined as follows:
-
- ddllii__ffnnaammee
- Contains a pointer to the file name of the containing object.
-
- ddllii__ffbbaassee
- Contains the base address (in memory) of the containing object.
-
- ddllii__ssnnaammee
- Contains a pointer to the nearest symbol name. This symbol
- either has the same address or is the nearest symbol with a lower
- address.
-
- ddllii__ssaaddddrr
- Contains the actual address of the above symbol.
-
- The following nonstandard field is in DDll__iinnffoo:
-
- ddllii__vveerrssiioonn
- This is filled in with zero by ddllaaddddrr(()).
-
- NNOOTTEESS
- If no symbol is found to describe the specified address, but the
- address is within a mapped-in object, the ddllii__ssnnaammee and ddllii__ssaaddddrr
- members are set to 0 by ddllaaddddrr(()).
-
- The memory pointed to by ddllii__ffnnaammee and ddllii__ssnnaammee is within the mapped
- object. If the object is closed with ddllcclloossee(()), the pointers become
- invalid.
-
- If the call is attempted on a system that does not have the supporting
- functionality, the following message will be emitted to //ddeevv//ttttyy by
- default, and the application will be terminated with a non-zero exit
- code:
-
- Fatal Error: _rld_new_interface: bad operation: 14
-
- Applications that might be executed on IRIX releases without the
- latest rrlldd should first attempt the call in a separate small process.
- Define the environment variable __RRLLDD__AARRGGSS as the following to direct
- the rrlldd message to disk, if its appearance on //ddeevv//ttttyy might be an
- annoyance:
-
- -log /tmp/rldmessage
-
- On a development system with ddllffccnn..hh missing DDll__iinnffoo and lliibbcc missing
- ddllaaddddrr(()), but with rrlldd implementing __RRLLDD__DDLLAADDDDRR, the following is a
- sample implementation that you might want to try. This sample
- implementation is not guaranteed to work, because user applications
- and DSOs should not call __rrlldd__nneeww__iinntteerrffaaccee, but it is provided with
- the hope that it will be useful.
-
- #include <rld_interface.h>
- #ifndef _RLD_INTERFACE_DLFCN_H_DLADDR
- #define _RLD_INTERFACE_DLFCN_H_DLADDR
- struct Dl_info {
- const char * dli_fname;
- void * dli_fbase;
- const char * dli_sname;
- void * dli_saddr;
- int dli_version;
- int dli_reserved1;
- long dli_reserved[4];
- };
- #endif
- #define _RLD_DLADDR 14
- int dladdr(void *address, struct Dl_info *dl);
-
- int dladdr(void *address, struct Dl_info *dl)
- {
- void *v;
- v = _rld_new_interface(_RLD_DLADDR,address,dl);
- return (int)v;
- }
-
- DDIIAAGGNNOOSSTTIICCSS
- The function returns zero if the address cannot be associated with a
- mapped-in object. In such a case, the DDll__iinnffoo fields are not touched.
-
- The function returns non-zero if it can be associated with a mapped-in
- object, and the DDll__iinnffoo fields are updated.
-
- SSEEEE AALLSSOO
- ddllooppeenn(3C), ddllcclloossee(3C), ddllssyymm(3C), ssggiiddllooppeenn__vveerrssiioonn(3C),
- ssggiiddllooppeenn__vveerriissoonn(3C)
- rrlldd(1)
- ddssoo(5)
-
- This man page is available only online.
-